package com.micro.frog.acct.service.impl;

import com.micro.frog.acct.dao.DictClassMapper;
import com.micro.frog.acct.entity.DictClass;
import com.micro.frog.acct.service.DictClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author :  ljh
 * @date : 2018/4/11
 **/
@Service
public class DictClassServiceImpl implements DictClassService {

    @Autowired
    DictClassMapper dictClassMapper;

    @Override
    public List<DictClass> list(DictClass queryVO) {
        return dictClassMapper.selectByCodition(queryVO);
    }

    @Override
    public int add(DictClass dictClass) {
        dictClass.setIsDeleted("N");
        return dictClassMapper.insertSelective(dictClass);
    }

    @Override
    public int delete(Integer id) {
        DictClass dictClass = new DictClass();
        dictClass.setId(id);
        dictClass.setIsDeleted("Y");
        return dictClassMapper.updateByPrimaryKeySelective(dictClass);
    }

    @Override
    public int update(DictClass dictClass) {
        return dictClassMapper.updateByPrimaryKeySelective(dictClass);
    }
}
